package com.mindata.blockchain.core.bean;

import org.tio.core.*;

import java.util.Objects;

public class ConsensusNode extends Node {
    private String adress;

    public ConsensusNode(String ip, int port) {
        super(ip, port);
    }

    public String getAdress() {
        return adress;
    }

    public void setAdress(String adress) {
        this.adress = adress;

    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (obj instanceof ConsensusNode) {
            return ((ConsensusNode) obj).adress.equals(this.adress);
        }
        return false;
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), adress);
    }
}
